<%@ page contentType="text/html;charset=UTF-8" %>
<!DOCTYPE html>
<html>

<head>
    <title>角色列表</title>
</head>

<body>

<div id="wrapper">
    <div class="gray-bg">
        <div class="row m-t-sm">
            <div class="col-lg-12">
                <ol class="breadcrumb f-fl">
                    <li>
                        <i class="fa fa-location-arrow"></i> <a>系统管理</a>
                    </li>
                    <li class="active">
                        <strong>角色列表</strong>
                    </li>
                </ol>
                <span class="navbar-right  m-r m-t-8"><a href="${ctx}/admin/sys/role/add" class="btn-primary btn-add "> <i class='fa fa-plus-square-o'></i> 新 增</a></span>
            </div>
        </div>
        <div class="wrapper wrapper-content animated fadeInRight">
            <div class="row">
                <div class="col-lg-12">
                    <div class="ibox">
                        <div class="ibox-content">
                            <%--<div class="search-area">--%>
                                <%--<form role="form" class="form-inline" id="queryform">--%>
                                    <%--<label for="roleName">--%>
                                        <%--<input type="input" placeholder="角色名" name="roleName"--%>
                                               <%--id="roleName"--%>
                                               <%--class="form-control form-filter"></label>--%>
                                    <%--<button class="btn btn-primary" type="button" onclick="submitFilter()"> 查询</button>--%>
                                <%--</form>--%>
                            <%--</div>--%>
                            <div class="table-responsive">
                                <table class="table table-striped table-bordered table-hover dataTables" id="data-table"></table>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</div>
</div>


<!-- Page-Level Scripts -->
<script>
    $(document).ready(function () {
        var setting = {
            "ajax": {
                "url": "${ctx}/admin/sys/role/list",
                "type": "POST"
            },
            "columns": [
                {"title": "角色名称", "data": "roleName", "name":"role_name", "width": "25%", "orderable": true},
                {"title": "角色说明", "data": "des", "width": "55%", "orderable": true},
                {"title": "操作", "data": null, "width": "20%", "orderable": false}
            ],
            "columnDefs": [
                {
                    "targets": 2,
                    "render": function (data, type, row, meta) {
                        return "<a class='btn btn-xs default btn-editable' href='${ctx}/admin/sys/role/update?id=" + data.roleId + "'><i class='fa fa-pencil-square-o'></i> 编辑 </a>";// +
/*
                                "<a class='btn btn-xs default btn-editable' data-opt data-opt-url='${ctx}/admin/sys/role/del' data-opt-pams='{\"id\":" + data.roleId + "}' data-opt-fun='$(\"#data-table\").DataTable().draw();'  ><i class='fa fa-minus-square-o'></i> 删除 </a>";
*/
                    },
                    "orderable": false
                }
            ],
            "order": [
                [1, "desc"]
            ],
        };
        /* Init DataTables */
        $('#data-table').DataTable(ehconfig.get_datatable_config(setting));
        submitFilter = function () {
            $('#data-table').DataTable().draw();
        }
    });

</script>

</body>

</html>
